HTMLModelElement: width property

The width property of the HTMLModelElement interface indicates the width at which a model is drawn in CSS pixels if it's being drawn or rendered to any visual medium such as a screen or printer.

Value

An integer value indicating the width of the model portal's display.

Impact on model presentation

While valid model content does possess dimensional data, the model's portal dimensions are not implicitly set by valid content. Because of this, the width and height of any model element will remain at the default element dimensions of 300 x 150px unless explicitly set with CSS, or specifying explicit width and height values through their respective attributes.

Initial presentation

A model's contents is set to automatically fit within the portal's width and height dimensions at the moment that the ready Promise is resolved. However, the resulting entityTransform is not updated during subsequent changes to the viewport dimensions, meaning that the model contents will remain the same size within the portal's overall dimensions.

stagemode="orbit"

An exception applies when a model has its stagemode attribute set to orbit, which will automatically fit the model contents into the available portal space, according to the "orbit fit" transformation guidelines. See orbit's impact on entityTransform for details.

Specifications

No specification found

No specification data found for api.HTMLModelElement.width.
Check for problems with this page or contribute a missing spec_url to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

Browser compatibility

See also